<?php

$dom1 = new DOMDocument('1.0', 'UTF-8');
$dom1->formatOutput = true;
$feed = $dom1->createElementNS("http://www.w3.org/2005/Atom", 'feed');
$dom1->appendChild($feed);

$dom = new DOMDocument('1.0', 'UTF-8');
$dom->formatOutput = true;
$entry_dom = $dom->createElementNS("http://www.w3.org/2005/Atom", 'entry');
$entry_dom->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:activity', 'http://activitystrea.ms/spec/1.0/');

$dom->appendChild($entry_dom);
$dom1->appendChild($dom);

echo $dom->saveXML();